# -*- coding: UTF-8 -*-
from .models import Mongodb, Mysql
from django.contrib.auth.decorators import login_required
from .forms import MysqlForm, MongodbForm,Mysql_Search_Form
from .function import Mysql_Public,Mongo_Public

@login_required()
def mysql_list(request):
    cls =Mysql_Public()
    return cls.url_get(request, app="database", template="mysql_list",
                 form=MysqlForm, models=Mysql,
                 search_form=Mysql_Search_Form)


@login_required()
def mongo_list(request):
    cls = Mongo_Public()
    return cls.url_get(request, app="database", template="mongo_list",
                 form=MongodbForm, models=Mongodb,
                 search_form=MongodbForm)


